package com.bkaka.service.impl;

import com.bkaka.dao.ExamQuestionDao;
import com.bkaka.entity.ExamQuestion;
import com.bkaka.service.ExamQuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by maxiaoqiang on 2018/9/3.
 */

@Service
public class ExamQuestionServiceImpl implements ExamQuestionService {

    @Autowired
    private ExamQuestionDao questionDao;

    @Override
    public List<ExamQuestion> findAll(Integer subjectId, Integer chapterId) {
        return questionDao.findAll(subjectId, chapterId);
    }

    @Override
    public List<ExamQuestion> findByRule(Integer examSubjectId, Integer examChapterId, Integer type, Integer level, Integer limit) {
        return questionDao.findByRule(examSubjectId, examChapterId, type, level, limit);
    }

    @Override
    public List<ExamQuestion> examQuestions(Integer examPaperId,List ids) {
        return questionDao.examQuestions(examPaperId, ids);
    }

    @Override
    public List<ExamQuestion> examMistake(Integer examSubjectId, Integer examChapterId, Integer userId) {
        return questionDao.examMistake(examSubjectId, examChapterId, userId);
    }

    @Override
    public ExamQuestion findById(Integer id) {
        return questionDao.findById(id);
    }

    @Override
    public void create(ExamQuestion question) {
        questionDao.create(question);
    }

    @Override
    public boolean delete(Integer id) {
        return questionDao.delete(id);
    }

    @Override
    public void update(ExamQuestion question) {
        questionDao.update(question);
    }
}
